#ifndef ADVANCED2D_H
#define ADVANCED2D_H

#include <allegro.h>
#include <iostream>
#include <string>
#include "timer.h"

#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define REVISION 0

//External variables and functions
extern bool gameover();
extern bool game_preload();
extern bool game_init();
extern bool game_update();
extern bool game_end();

namespace Advanced2D
{
    class Engine
    {
    public:
        Engine();
        virtual ~Engine();
        int init(int width, int height, int colorDepth, bool fullScreen);
        void close();
        void update();
        void message(std::string message, std::string title = "Advanced 2D");
        void fatalError(std::string message, std::string title = "Fatal Error");
        void shutdown();
        void clearScene();
        void setDefaultMaterial();
        void setAmbient();
        int renderStart();
        int renderStop();
        int release();

        //accesors
        bool isPaused();
        void setPaused(bool value);

    protected:
    private:
        int p_versionMajor, p_versionMinor, p_revision;
        std::string p_appTitle;
        bool p_fullScreen;
        int p_screenWidth;
        int p_screenHeight;
        int p_colorDepth;
        bool p_pauseMode;
        Timer p_coreTimer;
        long p_frameCount_core;
        long p_frameRate_core;
        Timer p_realTimer;
        long p_frameCount_real;
        long p_frameRate_real;
};

}



#endif // ADVANCED2D_H
